package com.dxysun.mine;

import com.netease.cloud.auth.BasicCredentials;
import com.netease.cloud.auth.Credentials;
import com.netease.cloud.services.nos.NosClient;

import java.io.File;

public class NosMain
{

	public static void main(String[] args)
	{

		String accessKey = "d8792c08101842e4b737b6f924fc19a5";
		String secretKey = "73c480324a3a45b7b708c08fec1de9b6";
		Credentials credentials = new BasicCredentials(accessKey, secretKey);
		NosClient nosClient = new NosClient(credentials);
		nosClient.setEndpoint("nos-eastchina1.126.net");

		//要上传文件的路径
		String filePath = "/Users/dongxiyan/myFiles/vim.png";
		try
		{
			File file = new File(filePath);

			nosClient.putObject("paygate-bill", file.getName(), file);
		}
		catch (Exception e)
		{
			System.out.println(e.getMessage());
		}

	}
}
